package CapaDatos;

public class HorarioSemanal
{
    public static final int DOMINGO   = 0;
    public static final int LUNES     = 1;
    public static final int MARTES    = 2;
    public static final int MIERCOLES = 3;
    public static final int JUEVES    = 4;
    public static final int VIERNES   = 5;
    public static final int SABADO    = 6;
    private Horario semana[];

    public HorarioSemanal()
    {
        this.semana = new Horario[7];
    }

    public HorarioSemanal(String granHorario)
    {
        int i;
        this.semana = new Horario[7];
        String semanal[] = granHorario.split("-_-");

        for (i = 0; i < 7; i++)
            this.semana[i] = new Horario(semanal[i]);
    }

    public void set (int DIA, String horaIni, String horaFin)
    {
        this.semana[DIA] = new Horario (horaIni, horaFin);
    }

    @Override
    public String toString () {
        String horario = "";
        int i;

        for (i = 0; i < 6; i++)
            horario += semana[i].toString() + "-_-";

        horario += semana[6].toString();

        return horario;
    }
}
